﻿create table dbo.CodeInfo (
   CodeId               nvarchar(10)         collate Chinese_PRC_CI_AS not null,
   ParentCodeId         nvarchar(10)         collate Chinese_PRC_CI_AS null,
   CategoryId           nvarchar(10)         collate Chinese_PRC_CI_AS null,
   CodeOrder            int                  null,
   EnglishValue         nvarchar(50)         collate Chinese_PRC_CI_AS null,
   ChineseValue         nvarchar(50)         collate Chinese_PRC_CI_AS null,
   IsEnable             bit                  null constraint DF_CodeInfo_IsEnable default 'true',
   CodeDescription      nvarchar(150)        collate Chinese_PRC_CI_AS null,
   CreateBy             nvarchar(10)         collate Chinese_PRC_CI_AS null,
   CreateOn             datetime             null constraint DF_CodeInfo_CreateOn default getdate(),
   ModifyBy             nvarchar(10)         collate Chinese_PRC_CI_AS null,
   ModifyOn             datetime             null,
   constraint PK_CodeInfo primary key (CodeId)
         on "PRIMARY"
)
on "PRIMARY"
go

execute sp_addextendedproperty 'MS_Description', 
   '编码ID',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CodeId'
go

execute sp_addextendedproperty 'MS_Description', 
   '编码分类父ID',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'ParentCodeId'
go

execute sp_addextendedproperty 'MS_Description', 
   '编码类型ID',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CategoryId'
go

execute sp_addextendedproperty 'MS_Description', 
   '编码排序',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CodeOrder'
go

execute sp_addextendedproperty 'MS_Description', 
   '英文值',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'EnglishValue'
go

execute sp_addextendedproperty 'MS_Description', 
   '中文值',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'ChineseValue'
go

execute sp_addextendedproperty 'MS_Description', 
   '是否启用（默认True）',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'IsEnable'
go

execute sp_addextendedproperty 'MS_Description', 
   '编码描述',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CodeDescription'
go

execute sp_addextendedproperty 'MS_Description', 
   '创建人',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CreateBy'
go

execute sp_addextendedproperty 'MS_Description', 
   '创建时间',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'CreateOn'
go

execute sp_addextendedproperty 'MS_Description', 
   '更改人',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'ModifyBy'
go

execute sp_addextendedproperty 'MS_Description', 
   '更改时间',
   'user', 'dbo', 'table', 'CodeInfo', 'column', 'ModifyOn'
go
